package controller

import (
	"log"
	"wire/internal/service"

	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
)

type UserController struct {
	UserService service.IUserService
	Logger      *zap.Logger
}

func NewUserController(engine *gin.Engine, UserSvc service.IUserService, Logger *zap.Logger) *UserController {
	ctl := &UserController{UserService: UserSvc, Logger: Logger}
	group := engine.Group("/user")
	group.GET("/info/:id", ctl.GetUserInfo())
	return ctl
}

func (receiver *UserController) GetUserInfo() gin.HandlerFunc {
	return func(context *gin.Context) {
		info := receiver.UserService.GetUserInfo()
		log.Println(info)
	}
}
